//
//  HMNavigationController.m
//  swift-新浪微博OC版-8-29
//
//  Created by 赵玉忠 on 16/8/29.
//  Copyright © 2016年 itcast. All rights reserved.
//

#import "HMNavigationController.h"
#import "UIBarButtonItem+HMBarButtonItem.h"
@interface HMNavigationController ()

@end

@implementation HMNavigationController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

-(void)pushViewController:(UIViewController *)viewController animated:(BOOL)animated{
    if (self.childViewControllers.count > 0) {
        viewController.navigationItem.leftBarButtonItem = [UIBarButtonItem HMBarButtonItem:@"navigationbar_back_withtext" andWithTitle:@"返回" andWithTarget:self andWithAction:@selector(pop)];
            viewController.hidesBottomBarWhenPushed = YES;
    }
    [super pushViewController:viewController animated:YES];
}
-(void)pop{
    [self popViewControllerAnimated:YES];
}

@end
